3.1 \(\int \frac{a+b \log (c x^n)}{d+e x+f x^2} \, dx\)

Optimal. Leaf size=173 \[ \frac{b n \text{PolyLog}\left (2,-\frac{2 f x}{e-\sqrt{e^2-4 d f}}\right )}{\sqrt{e^2-4 d f}}-\frac{b n \text{PolyLog}\left (2,-\frac{2 f x}{\sqrt{e^2-4 d f}+e}\right )}{\sqrt{e^2-4 d f}}+\frac{\log \left (\frac{2 f x}{e-\sqrt{e^2-4 d f}}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt{e^2-4 d f}}-\frac{\log \left (\frac{2 f x}{\sqrt{e^2-4 d f}+e}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt{e^2-4 d f}} \]

[Out]

((a + b*Log[c*x^n])*Log[1 + (2*f*x)/(e - Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f] - ((a + b*Log[c*x^n])*Log[1 +
(2*f*x)/(e + Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f] + (b*n*PolyLog[2, (-2*f*x)/(e - Sqrt[e^2 - 4*d*f])])/Sqrt[
e^2 - 4*d*f] - (b*n*PolyLog[2, (-2*f*x)/(e + Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f]

________________________________________________________________________________________

Rubi [A]  time = 0.179882, antiderivative size = 173, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {2357, 2317, 2391} \[ \frac{b n \text{PolyLog}\left (2,-\frac{2 f x}{e-\sqrt{e^2-4 d f}}\right )}{\sqrt{e^2-4 d f}}-\frac{b n \text{PolyLog}\left (2,-\frac{2 f x}{\sqrt{e^2-4 d f}+e}\right )}{\sqrt{e^2-4 d f}}+\frac{\log \left (\frac{2 f x}{e-\sqrt{e^2-4 d f}}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt{e^2-4 d f}}-\frac{\log \left (\frac{2 f x}{\sqrt{e^2-4 d f}+e}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt{e^2-4 d f}} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Log[c*x^n])/(d + e*x + f*x^2),x]

[Out]

((a + b*Log[c*x^n])*Log[1 + (2*f*x)/(e - Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f] - ((a + b*Log[c*x^n])*Log[1 +
(2*f*x)/(e + Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f] + (b*n*PolyLog[2, (-2*f*x)/(e - Sqrt[e^2 - 4*d*f])])/Sqrt[
e^2 - 4*d*f] - (b*n*PolyLog[2, (-2*f*x)/(e + Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f]

Rule 2357

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*Log[c*x^
n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]

Rule 2317

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(Log[1 + (e*x)/d]*(a +
b*Log[c*x^n])^p)/e, x] - Dist[(b*n*p)/e, Int[(Log[1 + (e*x)/d]*(a + b*Log[c*x^n])^(p - 1))/x, x], x] /; FreeQ[
{a, b, c, d, e, n}, x] && IGtQ[p, 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rubi steps

\begin{align*} \int \frac{a+b \log \left (c x^n\right )}{d+e x+f x^2} \, dx &=\int \left (\frac{2 f \left (a+b \log \left (c x^n\right )\right )}{\sqrt{e^2-4 d f} \left (e-\sqrt{e^2-4 d f}+2 f x\right )}-\frac{2 f \left (a+b \log \left (c x^n\right )\right )}{\sqrt{e^2-4 d f} \left (e+\sqrt{e^2-4 d f}+2 f x\right )}\right ) \, dx\\ &=\frac{(2 f) \int \frac{a+b \log \left (c x^n\right )}{e-\sqrt{e^2-4 d f}+2 f x} \, dx}{\sqrt{e^2-4 d f}}-\frac{(2 f) \int \frac{a+b \log \left (c x^n\right )}{e+\sqrt{e^2-4 d f}+2 f x} \, dx}{\sqrt{e^2-4 d f}}\\ &=\frac{\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac{2 f x}{e-\sqrt{e^2-4 d f}}\right )}{\sqrt{e^2-4 d f}}-\frac{\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac{2 f x}{e+\sqrt{e^2-4 d f}}\right )}{\sqrt{e^2-4 d f}}-\frac{(b n) \int \frac{\log \left (1+\frac{2 f x}{e-\sqrt{e^2-4 d f}}\right )}{x} \, dx}{\sqrt{e^2-4 d f}}+\frac{(b n) \int \frac{\log \left (1+\frac{2 f x}{e+\sqrt{e^2-4 d f}}\right )}{x} \, dx}{\sqrt{e^2-4 d f}}\\ &=\frac{\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac{2 f x}{e-\sqrt{e^2-4 d f}}\right )}{\sqrt{e^2-4 d f}}-\frac{\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac{2 f x}{e+\sqrt{e^2-4 d f}}\right )}{\sqrt{e^2-4 d f}}+\frac{b n \text{Li}_2\left (-\frac{2 f x}{e-\sqrt{e^2-4 d f}}\right )}{\sqrt{e^2-4 d f}}-\frac{b n \text{Li}_2\left (-\frac{2 f x}{e+\sqrt{e^2-4 d f}}\right )}{\sqrt{e^2-4 d f}}\\ \end{align*}

Mathematica [A]  time = 0.169253, size = 157, normalized size = 0.91 \[ \frac{b n \text{PolyLog}\left (2,\frac{2 f x}{\sqrt{e^2-4 d f}-e}\right )-b n \text{PolyLog}\left (2,-\frac{2 f x}{\sqrt{e^2-4 d f}+e}\right )+\left (\log \left (\frac{-\sqrt{e^2-4 d f}+e+2 f x}{e-\sqrt{e^2-4 d f}}\right )-\log \left (\frac{\sqrt{e^2-4 d f}+e+2 f x}{\sqrt{e^2-4 d f}+e}\right )\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt{e^2-4 d f}} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Log[c*x^n])/(d + e*x + f*x^2),x]

[Out]

((a + b*Log[c*x^n])*(Log[(e - Sqrt[e^2 - 4*d*f] + 2*f*x)/(e - Sqrt[e^2 - 4*d*f])] - Log[(e + Sqrt[e^2 - 4*d*f]
 + 2*f*x)/(e + Sqrt[e^2 - 4*d*f])]) + b*n*PolyLog[2, (2*f*x)/(-e + Sqrt[e^2 - 4*d*f])] - b*n*PolyLog[2, (-2*f*
x)/(e + Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f]

________________________________________________________________________________________

Maple [C]  time = 0.216, size = 555, normalized size = 3.2 \begin{align*} -2\,{\frac{bn\ln \left ( x \right ) }{\sqrt{4\,df-{e}^{2}}}\arctan \left ({\frac{2\,fx+e}{\sqrt{4\,df-{e}^{2}}}} \right ) }+2\,{\frac{b\ln \left ({x}^{n} \right ) }{\sqrt{4\,df-{e}^{2}}}\arctan \left ({\frac{2\,fx+e}{\sqrt{4\,df-{e}^{2}}}} \right ) }+{bn\ln \left ( x \right ) \ln \left ({ \left ( -2\,fx+\sqrt{-4\,df+{e}^{2}}-e \right ) \left ( \sqrt{-4\,df+{e}^{2}}-e \right ) ^{-1}} \right ){\frac{1}{\sqrt{-4\,df+{e}^{2}}}}}-{bn\ln \left ( x \right ) \ln \left ({ \left ( 2\,fx+\sqrt{-4\,df+{e}^{2}}+e \right ) \left ( e+\sqrt{-4\,df+{e}^{2}} \right ) ^{-1}} \right ){\frac{1}{\sqrt{-4\,df+{e}^{2}}}}}+{bn{\it dilog} \left ({ \left ( -2\,fx+\sqrt{-4\,df+{e}^{2}}-e \right ) \left ( \sqrt{-4\,df+{e}^{2}}-e \right ) ^{-1}} \right ){\frac{1}{\sqrt{-4\,df+{e}^{2}}}}}-{bn{\it dilog} \left ({ \left ( 2\,fx+\sqrt{-4\,df+{e}^{2}}+e \right ) \left ( e+\sqrt{-4\,df+{e}^{2}} \right ) ^{-1}} \right ){\frac{1}{\sqrt{-4\,df+{e}^{2}}}}}-{ib\pi \,{\it csgn} \left ( ic \right ){\it csgn} \left ( i{x}^{n} \right ){\it csgn} \left ( ic{x}^{n} \right ) \arctan \left ({(2\,fx+e){\frac{1}{\sqrt{4\,df-{e}^{2}}}}} \right ){\frac{1}{\sqrt{4\,df-{e}^{2}}}}}+{ib\pi \,{\it csgn} \left ( ic \right ) \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{2}\arctan \left ({(2\,fx+e){\frac{1}{\sqrt{4\,df-{e}^{2}}}}} \right ){\frac{1}{\sqrt{4\,df-{e}^{2}}}}}+{ib\pi \,{\it csgn} \left ( i{x}^{n} \right ) \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{2}\arctan \left ({(2\,fx+e){\frac{1}{\sqrt{4\,df-{e}^{2}}}}} \right ){\frac{1}{\sqrt{4\,df-{e}^{2}}}}}-{ib\pi \, \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{3}\arctan \left ({(2\,fx+e){\frac{1}{\sqrt{4\,df-{e}^{2}}}}} \right ){\frac{1}{\sqrt{4\,df-{e}^{2}}}}}+2\,{\frac{b\ln \left ( c \right ) }{\sqrt{4\,df-{e}^{2}}}\arctan \left ({\frac{2\,fx+e}{\sqrt{4\,df-{e}^{2}}}} \right ) }+2\,{\frac{a}{\sqrt{4\,df-{e}^{2}}}\arctan \left ({\frac{2\,fx+e}{\sqrt{4\,df-{e}^{2}}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*ln(c*x^n))/(f*x^2+e*x+d),x)

[Out]

-2*b/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*n*ln(x)+2*b/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d
*f-e^2)^(1/2))*ln(x^n)+b*n/(-4*d*f+e^2)^(1/2)*ln(x)*ln((-2*f*x+(-4*d*f+e^2)^(1/2)-e)/((-4*d*f+e^2)^(1/2)-e))-b
*n/(-4*d*f+e^2)^(1/2)*ln(x)*ln((2*f*x+(-4*d*f+e^2)^(1/2)+e)/(e+(-4*d*f+e^2)^(1/2)))+b*n/(-4*d*f+e^2)^(1/2)*dil
og((-2*f*x+(-4*d*f+e^2)^(1/2)-e)/((-4*d*f+e^2)^(1/2)-e))-b*n/(-4*d*f+e^2)^(1/2)*dilog((2*f*x+(-4*d*f+e^2)^(1/2
)+e)/(e+(-4*d*f+e^2)^(1/2)))-I/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*Pi*csgn(I*c)*csgn(I*x^n
)*csgn(I*c*x^n)+I/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*Pi*csgn(I*c)*csgn(I*c*x^n)^2+I/(4*d*
f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*Pi*csgn(I*x^n)*csgn(I*c*x^n)^2-I/(4*d*f-e^2)^(1/2)*arctan((
2*f*x+e)/(4*d*f-e^2)^(1/2))*b*Pi*csgn(I*c*x^n)^3+2/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*ln(
c)+2*a/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))/(f*x^2+e*x+d),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{b \log \left (c x^{n}\right ) + a}{f x^{2} + e x + d}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))/(f*x^2+e*x+d),x, algorithm="fricas")

[Out]

integral((b*log(c*x^n) + a)/(f*x^2 + e*x + d), x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*ln(c*x**n))/(f*x**2+e*x+d),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{b \log \left (c x^{n}\right ) + a}{f x^{2} + e x + d}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))/(f*x^2+e*x+d),x, algorithm="giac")

[Out]

integrate((b*log(c*x^n) + a)/(f*x^2 + e*x + d), x)